/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Models.DAO;

/**
 *
 * @author Don
 */
import DBConnection.ConnectionFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;

import Models.Admin;
import Models.ECA;

public class Admin_DAO {
    
    
    public boolean addECA(ECA eca){
        try{

            ConnectionFactory myFactory = ConnectionFactory.getFactory();
            Connection conn = myFactory.getConnection();
            int i = 1;
            
            PreparedStatement pstmt = conn.prepareStatement("INSERT INTO extra_curricular_activities(name, date, time, points) VALUES(?,?,?,?)");
            pstmt.setString(i++, eca.getName());
            pstmt.setDate(i++, eca.getDate());
            pstmt.setTime(i++, eca.getTime());
            pstmt.setFloat(i++, eca.getPoints());
            
            pstmt.executeUpdate();

            return true;
        }
        catch(Exception e){
            return false;
        }
    }
    
}
